<script setup lang="ts">
import { PropType, computed } from 'vue'
import { transformTextToImg } from '@/utils'

const $props = defineProps({
  decorationProperties: {
    type: Object as PropType<{ text: string }>,
    default() {
      return {}
    },
  },
})
const textnode = computed(() => transformTextToImg($props.decorationProperties.text))
</script>

<template>
  <view style="width: 100%; overflow: hidden">
    <rich-text class="rich-txt" :nodes="textnode"></rich-text>
  </view>
</template>

<style lang="scss" scoped>
.rich-txt {
  word-break: break-all;
  white-space: pre-line;
}
</style>
